package com.fsy.its.netty.msg;

import lombok.Data;
import lombok.ToString;

import java.time.LocalDateTime;

/**
 * 消息控制头（控制单元）
 */
@Data
@ToString
public class MsgHead {

    /**
     * 命令字定义
     */
    public static final short CMD_CTRL = 1;   //控制命令
    public static final short CMD_SEND = 2;   //发送数据
    public static final short CMD_CONFIRM = 3;    //确认
    public static final short CMD_REQUEST = 4;    //请求
    public static final short CMD_RESPONSE = 5;   //应答
    public static final short CMD_DENY = 6;       //否认

    public int sequence;   //流水号

    public int version;    //协议版本

    public LocalDateTime time;      //消息时间戳

    public String srcAddr; //源地址

    public String dstAddr; //目的地址

    public short command;  //命令字
}
